<?php
namespace Club\Controller;
use Think\Controller;
class PublicController extends Controller {
    
	 public function _initialize(){
        header("Content-type:text/html;charset=utf-8");
        $this->checkAdmin();
    }
    
    private function checkAdmin(){
        if(ACTION_NAME!='index' && ACTION_NAME!='login'){
            if(null==session('flag')|| session('flag')!='no'){
            $this->error('无权限访问此页', U('Home/index/index'));
            }
        }
    }

    function signout(){
        session('flag',null);
        $this -> redirect('index/index');
    }
}